/*
package com.yyw.yyw.ft_viewimgs

import android.view.View
import android.view.ViewGroup
import androidx.viewpager.widget.PagerAdapter
import com.luck.picture.lib.photoview.PhotoView
import com.yyw.yyw.imgload.glide.display

class DraweePagerAdapter(private val imgsUrl: List<String>,
                         val tapFunc: ()->Unit,
                         val loadCallBack: (isSuc:Boolean)->Unit)
                         : PagerAdapter() {

    override fun getCount(): Int {
        return imgsUrl.size
    }

    override fun isViewFromObject(view: View, `object`: Any): Boolean {
        return view === `object`
    }

    override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
        container.removeView(`object` as View?)
    }

    override fun instantiateItem(container: ViewGroup, position: Int): Any {
        val photoView = PhotoView(container.context)

        photoView.setOnPhotoTapListener { _, _, _ -> tapFunc() }
        photoView.setOnOutsidePhotoTapListener { tapFunc() }
        //photoView.setOnViewTapListener((view, x, y) -> finish());
        try {
            container.addView(
                photoView,
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT
            )
        } catch (e: Exception) {
            e.printStackTrace()
        }
        display(photoView, if(count > position) imgsUrl[position] else null, callFunc = {
            loadCallBack(it)
        })
        return photoView
    }
}*/
